package com.example.sysao.service.impl;

import com.example.sysao.mapper.RepairMapper;
import com.example.sysao.pejo.Repair;
import com.example.sysao.service.ReapirService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RepairServiceImp implements ReapirService {
    @Resource
    private RepairMapper repairMapper;

    @Override
    public List<Repair> findAll() {
        return repairMapper.selectall();
    }

    @Override
    public Repair findById(int id) {
        return repairMapper.selectById(id);
    }

    @Override
    public boolean addRepair(Repair repair) {
        return repairMapper.insertRepair(repair) != 0;
    }

    @Override
    public boolean removeRepair(int id) {
        return repairMapper.deleteById(id) != 0;
    }

    @Override
    public boolean saveRepair(Repair repair) {
        return repairMapper.updateRepatr(repair) != 0;
    }

    @Override
    public List<Repair> selectByKeyWords(String detail, String place) {
        return repairMapper.selectByKeyWords(detail, place);
    }


    @Override
    public List<Repair> findByid() {
        return repairMapper.selectByid();
    }

    @Override
    public List<Repair> findByStatus() {
        return repairMapper.selectByStatus();
    }

    @Override
    public List<Repair> findByStatus1(int page, int size) {
        return repairMapper.selectByStatus1(page, size);
    }

    @Override
    public List<Repair> findByStatus1() {
        return repairMapper.selectUall();
    }

    @Override
    public List<Repair> findByDetail(String detail) {
        return repairMapper.findByDtail(detail);
    }

    @Override
    public List<Repair> findByStatus2() {
        return repairMapper.selectByStatus2();
    }
}
